using DynConDevCorp.OpenArch.SmartData.Interfaces;

namespace DynConDevCorp.OpenArch.SmartData.Interfaces.UserInterface.WinForms
{
    /// <summary>
    /// Provides capabilities for coordinating the binding between SmartFields and SmartControls.
    /// </summary>
    public interface ISmartBinder
    {
        #region Public Instance Properties

        /// <summary>
        /// Gets or sets the items.
        /// </summary>
        /// <value>The items.</value>
        ISmartFieldKeyedCollection<object, ISmartField> Items { get; set; }

        #endregion

        #region Public Instance Methods

        /// <summary>
        /// Binds the specified item name.
        /// </summary>
        /// <param name="itemName">Name of the item.</param>
        /// <param name="control">The control.</param>
        void Bind(string itemName, ISmartControl control);

        /// <summary>
        /// Tries the get item.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="smartData">The smart data.</param>
        /// <returns></returns>
        bool TryGetItem(string name, out ISmartField smartData);

        #endregion
    }
}